<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>axios快速使用</title>
  <script src="./dist/bundle.js"></script>
</head>

<body>
  <button onclick="cancelRequest()">取消</button>
  <script>
    var CancelToken = axios.CancelToken
    function cancelRequest() {
      cancel()
    }
    var cancel;

    axios.get('http://localhost:3000/posts/1', {
      data: { 'key': 'value' }
    }).then(result => {
      console.log(result)
    })

  </script>
</body>

</html>